-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Configuration properties changelog generator misses items that are removed without prior deprecation #45267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The changelog generator did not detect properties that were added to a new version with error-level deprecation (indicating immediate removal). This commonly occurs when upgrading dependencies like Flyway 10, where properties are removed without prior deprecation. Modified the computeDifferences method to detect properties that only exist in the new metadata with error-level deprecation and properly mark them as DELETED in the changelog. Signed-off-by: yybmion <yunyubin54@gmail.com>
if (newProperty == null) { | ||
differences.add(new Difference(DifferenceType.DELETED, oldProperty, null)); | ||
} | ||
else { | ||
Difference difference = Difference.compute(oldProperty, newProperty); | ||
if (difference != null) { | ||
differences.add(difference); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change isn't necessary as Difference.compute
already handles the case where newProperty
is null
. Additionally, it checks that the old property isn't deprecated at error level before reporting a difference, something that's lost here.
I'll revert this part of the changes and add a test for this scenario (removing metadata for a property that's deprecated at error level) as part of merging this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate your explanation about why that part of the change wasn't necessary and how the existing code already handles the case.
The changelog generator did not detect properties that were added to a new version with error-level deprecation (indicating immediate removal). This commonly occurs when upgrading dependencies like Flyway 10, where properties are removed without prior deprecation. Modified the computeDifferences method to detect properties that only exist in the new metadata with error-level deprecation and properly mark them as DELETED in the changelog. See gh-45267 Signed-off-by: yybmion <yunyubin54@gmail.com>
Thanks very much, @yybmion, and congratulations on making your first contribution to Spring Boot. |
Thank you @wilkinsona for reviewing and merging the PR! |
Issue
Closes #40075
The configuration properties changelog generator misses items that are removed without prior deprecation. When a property is removed without being deprecated first (like during the Flyway 10 upgrade), these changes are reflected in the metadata but not included in the generated changelog.
Solution
Modified the
computeDifferences
method in theChangelog
class to detect properties that only exist in the new metadata with error-level deprecation and properly mark them as DELETED in the changelog. This ensures that properties that are added to a new version with error-level deprecation (indicating immediate removal) are correctly included in the "Removed in X.X" section of the changelog.Specifically, added logic to check for properties in the new metadata that
Tests
The existing test
diffContainsDifferencesBetweenLeftAndRightInputs
already verifies this functionality by testing that properties with error-level deprecation are properly classified as DELETED.To make the test cover this fix, we enhanced the
sample-2.0.json
test data to include an additional property (test.removed.directly
) that demonstrates a property removed without prior deprecation, marked with error-level deprecation and a reason "Removed in Upgrade 10".After fix, this test confirms that both regular removed properties and those marked with error-level deprecation are correctly included in the changelog.